#pragma once
#ifndef SMPPBINARYDECODER_HPP
#define SMPPBINARYDECODER_HPP

#include "SMPPBind.hpp"
#include "SMPPBindResp.hpp"
#include "SMPPOutbind.hpp"
#include "SMPPUnbind.hpp"
#include "SMPPUnbindResp.hpp"
#include "SMPPEnquireLink.hpp"
#include "SMPPEnquireLinkResp.hpp"
#include "SMPPAlertNotification.hpp"
#include "SMPPGenericNack.hpp"
#include "SMPPSubmitSM.hpp"
#include "SMPPSubmitSMResp.hpp"
#include "SMPPDataSM.hpp"
#include "SMPPDataSMResp.hpp"
#include "SMPPSubmitMulti.hpp"
#include "SMPPSubmitMultiResp.hpp"
#include "SMPPDeliverSM.hpp"
#include "SMPPDeliverSMResp.hpp"
#include "SMPPBroadcastSM.hpp"
#include "SMPPBroadcastSMResp.hpp"
#include "SMPPCancelSM.hpp"
#include "SMPPCancelSMResp.hpp"
#include "SMPPQuerySM.hpp"
#include "SMPPQuerySMResp.hpp"
#include "SMPPReplaceSM.hpp"
#include "SMPPReplaceSMResp.hpp"
#include "SMPPQueryBroadcastSM.hpp"
#include "SMPPQueryBroadcastSMResp.hpp"
#include "SMPPCancelBroadcastSM.hpp"
#include "SMPPCancelBroadcastSMResp.hpp"
#include <QByteArray>

using namespace smpp::pdu;

namespace smpp{
namespace decoder{

class SMPP_DLLPRFX Decoder{
	int _Possition;
	int _MaxPossition;
	quint32 _LastError;
	QByteArray _Massive;
public:
	Decoder(const QByteArray &nMassive = QByteArray());

	Decoder(const Decoder &);

	void setMassive(const QByteArray &);

	const QByteArray getMassive() const;

	void setMassivePossition(const int);

	const int getMassivePossition() const;

	void setMaxMassivePossition(const int);

	const int getMaxMassivePossition() const;

	void clearMassive();

	const quint32 getLastError() const;

	bool _quint8(quint8 &);

	bool _quint16(quint16 &);

	bool _quint32(quint32 &);

	bool _octetString(octetString &,const quint16);

	bool _CoctetString(CoctetString &);

	bool _Header(Header &);

	bool _TLVbase(TLV &);

	bool _CancelBroadcastOptionalTLVs(const TLV &,
		CancelBroadcastOptionalTLVs &);

	bool _QueryBroadcastRequestOptionalTLVs(const TLV &,
		QueryBroadcastRequestOptionalTLVs &);

	bool _QueryBroadcastResponseOptionalTLVs(const TLV &,
		QueryBroadcastResponseOptionalTLVs &);

	bool _MessageReplacementTLVs(const TLV &,
		MessageReplacementTLVs &);

	bool _BroadcastRequestOptionalTLVs(const TLV &,
		BroadcastRequestOptionalTLVs &);

	bool _BroadcastResponseOptionalTLVs(const TLV &,
		BroadcastResponseOptionalTLVs &);

	bool _MessageDeliveryRequestTLVs(const TLV &,
		MessageDeliveryRequestTLVs &);

	bool _MessageDeliveryResponseTLVs(const TLV &,
		MessageDeliveryResponseTLVs &);

	bool _MessageSubmissionRequestTLVs(const TLV &,
		MessageSubmissionRequestTLVs &);

	bool _MessageSubmissionResponseTLVs(const TLV &,
		MessageSubmissionResponseTLVs &);

	bool _DestAddress(DestAddress &);

	bool _UnsuccessSME(UnsuccessSME &);

	bool _BindBody(Bind &);

	bool _BindRespBody(BindResp &);

	bool _OutbindBody(Outbind &);

	bool _AlertNotificationBody(AlertNotification &);

	bool _SubmitSMBody(SubmitSM &);

	bool _SubmitSMRespBody(SubmitSMResp &);

	bool _DataSMBody(DataSM &);

	bool _DataSMRespBody(DataSMResp &);

	bool _SubmitMultiBody(SubmitMulti &);


	bool _SubmitMultiRespBody(SubmitMultiResp &);

	bool _DeliverSMBody(DeliverSM &);

	bool _DeliverSMRespBody(DeliverSMResp &);

	bool _BroadcastSMBody(BroadcastSM &);

	bool _BroadcastSMRespBody(BroadcastSMResp &);

	bool _CancelSMBody(CancelSM &);

	bool _QuerySMBody(QuerySM &);

	bool _QuerySMRespBody(QuerySMResp &);

	bool _ReplaceSMBody(ReplaceSM &);

	bool _QueryBroadcastSMBody(QueryBroadcastSM &);

	bool _QueryBroadcastSMRespBody(QueryBroadcastSMResp &);

	bool _CancelBroadcastSMBody(CancelBroadcastSM &);
};

}
}

#endif
